f = open('111.txt', 'r', encoding='utf-8')
print(f.read())

with open('222.txt', 'r', encoding='utf-8') as ff:
    text = ff.read()
print(text)

ff = open(r'C:\Users\Administrator\Desktop\333.txt', encoding='utf-8')
print(ff.read())

print('-------------------------------------')

fff = open('333.txt', 'w', encoding='utf-8')
fff.write('hello world, hello python!')
fff.close()

date = '你好'
with open('333.txt', 'a', encoding='utf-8') as f:
    f.write(date)

print('----------------------------------------')

import pandas as pd

df = pd.read_excel(r'C:\Users\Administrator\Desktop\111.xlsx')
print(df)

d1 = {'姓名': 'zhang', '年龄': '26'}
d2 = {'姓名': 'zhao', '年龄': '27'}
d3 = {'姓名': 'gao', '年龄': '21'}
l1 = [d1, d2, d3]
print(l1)

df1 = pd.DataFrame(l1)
print(df1)

df1.to_excel('222.xlsx', index=False)

print('----------------------------------------')

from docx import Document

doc = Document('2023年国务院政府工作报告.docx')
print(doc)

p = doc.paragraphs
print(p)
print(len(p))

for i in p:
    print(i)
    print(i.text)